package com.example.flower_shop.dto.order;

import com.example.flower_shop.entity.CustomerOrder;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class OrderVO {
    private Long id;
    private String orderNo;
    private BigDecimal totalAmount;
    private Integer status;
    private String receiverName;
    private String receiverPhone;
    private String receiverAddress;
    private LocalDateTime createTime;
    private LocalDateTime payTime;
    private LocalDateTime shipTime;
    private LocalDateTime completeTime;
    private LocalDateTime cancelTime;
    private List<OrderItemVO> orderItems;

    public OrderVO(CustomerOrder order) {
        this.id = order.getId();
        this.orderNo = order.getOrderNo();
        this.totalAmount = order.getTotalAmount();
        this.status = order.getStatus();
        this.receiverName = order.getReceiverName();
        this.receiverPhone = order.getReceiverPhone();
        this.receiverAddress = order.getReceiverAddress();
        this.createTime = order.getCreateTime();
        this.payTime = order.getPayTime();
        this.shipTime = order.getShipTime();
        this.completeTime = order.getCompleteTime();
        this.cancelTime = order.getCancelTime();
    }
}